package cn.xiuxius.embedded.config;

import com.fasterxml.jackson.annotation.JsonCreator;
import lombok.Getter;

@Getter
public enum EasyYamlVersion {
    V1_0_0("1.0.0"),
    V1_0_1("1.0.1"),
    ;
    private final String version;

    EasyYamlVersion(String version) {
        this.version = version;
    }


    @JsonCreator
    public static EasyYamlVersion fromString(String version) {
        for (EasyYamlVersion v : EasyYamlVersion.values()) {
            if (v.version.equals(version)) {
                return v;
            }
        }
        throw new IllegalArgumentException("Unknown version: " + version);
    }


    @Override
    public String toString() {
        return version;
    }


}
